﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace Web.manager
{
    public partial class sysmoduleadd : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                ddl_systemid_SelectedIndexChanged(ddl_systemid, new EventArgs());
            }
        }

        protected void ddl_systemid_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataSet ds = PhoneBook.Manage.sysModule.getTopModule(ddl_systemid.SelectedValue);
            Commons.ControlUtil.BindDDL(ddl_parentid, ds, "modulename", "moduleid", "顶级模块", "");
        }

        protected void btn_save_Click(object sender, EventArgs e)
        {
            Hashtable sysmodule = new Hashtable();
            sysmodule["modulename"] = txb_modulename.Text;
            sysmodule["urladdress"] = txb_urladdress.Text;
            sysmodule["systemid"] = ddl_systemid.Text;
            sysmodule["parentid"] = ddl_parentid.Text;
            sysmodule["showxh"] = txb_showxh.Text;
            sysmodule["description"] = txb_description.Text;
            PhoneBook.Manage.sysModule.add(sysmodule);
            Helper.ShowMessage(u_message, controls.UCMessageType.success, "保存成功");

            AddLog("新添加了模块：{0}", sysmodule["modulename"]);
        }
    }
}